#include <iostream>
#include <portaudio.h>

using namespace std;

int main(int argc, char const *argv[])
{
    Pa_Initialize();
	cout<<"*******Deviceinfo Demo*******"<<endl;
	cout<<"*****************************"<<endl;

    cout<<"Default input  device : "<<Pa_GetDeviceInfo(Pa_GetDefaultInputDevice()) ->name<<" NO."<<Pa_GetDefaultInputDevice() <<endl;
    cout<<"Default output device : "<<Pa_GetDeviceInfo(Pa_GetDefaultOutputDevice())->name<<" NO."<<Pa_GetDefaultOutputDevice()<<endl;

    int numDevices = Pa_GetDeviceCount();
    cout<<"Number of device : "<<numDevices<<endl;

    for(int i=0;i<numDevices;i++){
    	cout<<"NO."<<i<<" ";
        cout<<Pa_GetDeviceInfo(i)->name<<" ";
        cout<<Pa_GetDeviceInfo(i)->defaultSampleRate<<endl;
    }

    Pa_Terminate();

	return 0;
}